var openalllinks = {
  onMenuItemCommand: function(e) {
    var msgPane = document.getElementById("messagepane");
    
    if ( msgPane )
    {
        var anchors = msgPane.contentDocument.getElementsByTagName("a");
        var href;
        
        for ( var i = 0; i < anchors.length; i++ )
        {
            href = anchors[i].href;
            if ( href.substring(0,7) == 'http://' || href.substring(0,8) == 'https://' )
            {
                messenger.launchExternalURL( href );
            }
        }
    }
  }
};